// logdb
package swdb

import (
	"time"
	//"database/sql"
	//	"fmt"
	//	"io"
	"log"
)

//say_flag:说话标识1为cid到sid，2为sid到cid
//cid是web服务的ID，sid是服务人员ID
func WriteMsgLog(say_flag int, ip, cid, content, filepath,
	service_account, sid string) {
	var t int64 = time.Now().Unix()
	var sTime string = time.Unix(t, 0).Format("2006-01-02 15:04:05")
	insert_sql := "insert into chatlog (say_flag,ip,cid,content,filepath,service_account,sid,time)values (?,?,?,?,?,?,?,?)"
	_, err := SwDbPool.Exec(insert_sql, say_flag, ip, cid, content, filepath,
		service_account, sid, sTime)
	if err != nil {
		log.Println(err.Error())
	}
}
